# Maintainer: David Runge <dvzrv@archlinux.org

pkgname=guitarix
pkgver=0.44.1
pkgrel=4
pkgdesc="A simple mono guitar amplifier and FX for JACK using Faust"
arch=(loong64 x86_64)
url="https://guitarix.org"
license=(GPL3)
groups=(ladspa-plugins lv2-plugins pro-audio)
depends=(atkmm bluez-libs cairo cairomm gcc-libs glibc glibmm gtkmm3 libsigc++
libx11 pangomm ttf-roboto)
makedepends=(avahi boost curl gdk-pixbuf2 eigen faust fftw glib2 gperf gtk3
intltool jack ladspa liblo liblrdf lilv lv2 pango sassc waf zita-convolver
zita-resampler)
optdepends=('new-session-manager: for session management')
provides=(guitarix2 libgxw.so libgxwmm.so ladspa-host lv2-host)
conflicts=(guitarix2)
replaces=(guitarix2)
source=($pkgname-$pkgver.tar.xz::https://download.sourceforge.net/project/guitarix/guitarix/${pkgname}2-$pkgver.tar.xz)
sha512sums=('d2c0e40762d97ed7ce61c3115fc3800cc569a2bb4f66e09147507a9eaa815fb9d1363444353a5854035755bd1b1e247ccb341aed60ca0ecf6a77019da73064c1')
b2sums=('57a1ad0be133fe2851ff7539d5c467a649774a1de90569e83feeb3ba2b05324ce0ee6d4388122cdb3fdcb36afac4cb7cfd2d6ab0216ff2f56d8e7c2886d14152')

build() {
  cd $pkgname-$pkgver
  export LINKFLAGS="$LDFLAGS"
  waf configure --prefix=/usr \
                --enable-nls \
                --ladspa \
                --new-ladspa \
                --shared-lib \
                --lib-dev \
                --cxxflags='-flto' \
                --ldflags="$LDFLAGS"
  waf build -vv
}

package() {
  depends+=(libavahi-common.so libavahi-gobject.so libboost_iostreams.so
  libcurl.so libfftw3f.so libgdk-3.so libgdk_pixbuf-2.0.so libgio-2.0.so
  libglib-2.0.so libgobject-2.0.so libjack.so liblilv-0.so liblo.so liblrdf.so
  libpangocairo-1.0.so libpango-1.0.so libsndfile.so libzita-convolver.so
  libzita-resampler.so)

  cd $pkgname-$pkgver
  waf install --destdir="$pkgdir"
  # docs
  install -vDm 644 {changelog,README} -t "$pkgdir/usr/share/doc/$pkgname/"
}
